using System;
using System.Data;
using System.Data.Odbc;
using System.Configuration;
using System.Collections;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Reviewer.Entities.Services;
using Reviewer.Business;
using Reviewer.Entities;

public partial class public_html_Info : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            int id = -1;
            if (!int.TryParse(Request["id"], out id))
            {
                Response.Redirect("404.aspx");
            }

            using (ISystemTextService service = ServiceFactory.SystemTextService)
            {
                SystemText entity = service.Find(id);
                if (entity == null)
                {
                    Response.Redirect("404.aspx");
                }

                switch (id)
                {
                    case 1:
                        lblOverskrift.Text = "Om Reviewer.dk";
                        break;
                    case 2:
                        lblOverskrift.Text = "Redaktionen";
                        break;
                    case 3:
                        lblOverskrift.Text = "Ophavsret";
                        break;
                    default:
                        lblOverskrift.Text = "Ingen tekst valgt";
                        break;
                }

                lblTekst.Text = Regex.Replace(entity.Text, Environment.NewLine, "<br />");
            }
        }
    }
}
